<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <!--1. .stop 防止事件冒泡    -->
    <div @click="divClick">
        aaaaaa
        <button @click="btnClick">按钮</button>
    </div>

    <!--2. .prevent阻止默认事件（默认提交表单）   -->
    <form action="aaa">
        <input type="submit" value="提交" @click.prevent="submitClick">
    </form>

    <!-- 3.监听某个按键   -->
    <input type="text" @keyup.enter="enterKeyUp">
</div>
<script src="../js/vue.js"></script>
<script>
    const aaa = new Vue({
        el: "#app",
        data: {
            message: "hello,guys",
        },
        methods:{
            btnClick(){
                console.log("btnClick");
            },
            divClick(){
                console.log("divClick");
            },
            submitClick(){
                console.log("submitClick");
            },
            enterKeyUp(){
                console.log("enterKeyUp");
            }
        }
    })
</script>
</body>
</html>